package quoridorDecisionMaker;

import quoridor.Board;
import quoridor.PlayerColour;

public class Heuristic {
	final static int distanceDifferenceWeight = 10;
	final static int fenceNumDifferenceWeight = 1;
	
	public static int scoreBoard(Board board, PlayerColour player) {
		int score = 0;
		int difference;
		PlayerColour otherPlayer = PlayerColour.otherColour(player);

		difference = board.distanceToFinish(otherPlayer) -  board.distanceToFinish(player);
		score += difference * distanceDifferenceWeight;
		difference = board.getFenceNum(player) - board.getFenceNum(otherPlayer);
		score += difference * fenceNumDifferenceWeight;
		
		if (board.distanceToFinish(otherPlayer) <= 1) {
			score = Integer.MIN_VALUE;
		}
		if (board.distanceToFinish(player) == 0) {
			score = Integer.MAX_VALUE;
		}
		
		
	
		return score;
	}
}
